home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_actor_bugaet.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  99 lines

  1. # Jones 3D Cog Script
  2. #
  3. # actor_BugAet.cog
  4. #
  5. # [RT]
  6. #
  7. # Animates cute little bug legs.
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ===================================================================
  12.  
  13. symbols
  14.  
  15.     message        created
  16.     message        aievent
  17.     message        killed
  18.    
  19. # ************************** TEMPLATES *************************
  20.     material    legs=cbleg4.mat                local
  21.  
  22.     model        liveBug=gen_sb.3do            local
  23.     model        deadBug=gen_sb_dead.3do        local
  24.  
  25. # ************************** MISC LOCAL VARS *******************
  26.     thing        bug                            local
  27.  
  28.     int            newMode                        local
  29.     int            oldMode                        local
  30.  
  31. end
  32.  
  33. # ===================================================================
  34. code
  35.  
  36. # -------------------------------------------------------------------
  37. created:
  38.  
  39.     bug = GetSenderRef();
  40.  
  41.     SetThingModel(bug, deadBug);
  42.     MaterialAnim(legs, 8.0, 0x1);
  43.  
  44.     AISetMode(bug, 0x20);                            # Set MODE_TOUGHSKIN
  45.  
  46.     return;
  47.  
  48.  
  49. # -------------------------------------------------------------------
  50. aievent:
  51.  
  52.     bug = GetSenderRef();
  53.  
  54.     # See if the mode has changed
  55.     if (BITTEST(GetParam(0), 0x100))
  56.     {
  57.         newMode = GetParam(1);
  58.         oldMode = GetParam(2);
  59.  
  60.         # See if he just started moving
  61.         if ((BITTEST(newMode, 0x1)) && (!BITTEST(oldMode, 0x1)))
  62.         {
  63.             PlaySoundClass(bug, RandBetween(6,7));                            # play 'walk' sound
  64.  
  65.             if (GetThingModel(bug) != liveBug)
  66.                 SetThingModel(bug, liveBug);
  67.         }
  68.     }
  69.     # See if he just stopped
  70.     else if (BITTEST(GetParam(0), 0x800))
  71.     {
  72.         StopSoundClass(bug, 6);
  73.         StopSoundClass(bug, 7);
  74.  
  75.            if (GetThingModel(bug) != deadBug)
  76.         {
  77.             SetThingModel(bug, deadBug);
  78.         }
  79.     }
  80.  
  81.     return;
  82.  
  83.  
  84. # -------------------------------------------------------------------
  85. killed:
  86.  
  87.     bug = GetSenderRef();
  88.  
  89.     if (GetThingModel(bug) != deadBug)
  90.     {
  91.         SetThingModel(bug, deadBug);
  92.     }
  93.  
  94.     return;
  95.  
  96.  
  97. end
  98.  
  99.